import request from '@/config/axios'

// 多边形操作日志 VO
export interface MapPolygonLogVO {
  id: number // 日志ID
  polygonId: string // 多边形ID
  operateType: number // 操作类型：1-创建，2-更新，3-删除
  content: string // 操作内容（JSON格式存储变更详情）
  operatorId: string // 操作人ID
  operatorName: string // 操作人名称
  operateTime: Date // 操作时间
  ip: string // 操作IP地址
}

// 多边形操作日志 API
export const MapPolygonLogApi = {
  // 查询多边形操作日志分页
  getMapPolygonLogPage: async (params: any) => {
    return await request.get({ url: `/member/map-polygon-log/page`, params })
  },

  // 查询多边形操作日志详情
  getMapPolygonLog: async (id: number) => {
    return await request.get({ url: `/member/map-polygon-log/get?id=` + id })
  },

  // 新增多边形操作日志
  createMapPolygonLog: async (data: MapPolygonLogVO) => {
    return await request.post({ url: `/member/map-polygon-log/create`, data })
  },

  // 修改多边形操作日志
  updateMapPolygonLog: async (data: MapPolygonLogVO) => {
    return await request.put({ url: `/member/map-polygon-log/update`, data })
  },

  // 删除多边形操作日志
  deleteMapPolygonLog: async (id: number) => {
    return await request.delete({ url: `/member/map-polygon-log/delete?id=` + id })
  },

  // 导出多边形操作日志 Excel
  exportMapPolygonLog: async (params) => {
    return await request.download({ url: `/member/map-polygon-log/export-excel`, params })
  }
}